home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / gymake12.zip / MAKE.H < prev    next >
C/C++ Source or Header  |  1988-11-18  |  3KB  |  89 lines

  1. /*
  2.  * make.h
  3.  *
  4.  * 88-10-01 v1.0    created by greg yachuk, placed in the public domain
  5.  * 88-10-06 v1.1    changed prerequisite list handling
  6.  * 88-11-11 v1.2    fixed some bugs and added environment variables
  7.  *
  8.  */
  9.  
  10. #define    MAXNEGTIME    0x80000000
  11.  
  12. #ifndef    TRUE
  13. #define    TRUE    1
  14. #define    FALSE    0
  15. #endif
  16.  
  17. #define    equal(s,t)        (!strcmp((s),(t)))
  18. #define    get_target(t)        hash_target((t), NULL)
  19. #define    get_file(f)        hash_file((f), NULL)
  20. #define    append_preq(t,p)    (fileptr*)append_node((char**)(t),(char**)(p),sizeof(fileptr*))
  21. #define    append_shell(t,s)    (shellptr*)append_node((char**)(t),(char**)(s),sizeof(shellptr*))
  22.  
  23. typedef    unsigned short t_mask;
  24.  
  25. typedef    struct targnode
  26. {
  27.     t_mask    tmask;            /* mask to avoid string compares */
  28.     struct targnode *tnext;        /* next target in global target list */
  29.     struct filenode *tfile;        /* file node for this target */
  30.     struct filenode **tpreq;    /* pre-req list for this target */
  31.     struct shellnode **tshell;    /* command list for this target */
  32. }    targnode, *targptr;
  33.  
  34. typedef    struct filenode
  35. {
  36.     t_mask    fmask;            /* mask to avoid string compares */
  37.     char   *fname;            /* name of this file (targ, preq...) */
  38.     long    ftime;            /* last MODIFY time for this file */
  39.     struct filenode *fnext;        /* next file node in global file list */
  40. }    filenode, *fileptr;
  41.  
  42. typedef    struct shellnode
  43. {
  44.     char   *scmd;            /* text of command */
  45.     unsigned s_silent:1;        /* don't echo before executing */
  46.     unsigned s_ignore:1;        /* ignore exit status */
  47.     unsigned s_shell:1;        /* force spawning of command.com */
  48.     struct shellnode *snext;    /* next shell node for a target */
  49.     struct shellnode *slink;    /* next shell node in global list */
  50. }    shellnode, *shellptr;
  51.  
  52. typedef    struct symnode
  53. {
  54.     t_mask    smask;            /* mask to avoid string compares */
  55.     char   *sname;            /* name of a symbol */
  56.     char   *svalue;            /* value of a symbol */
  57.     struct symnode *snext;        /* next symbol node in global list */
  58.     int    scmd;            /* command line macro? */
  59.     int    slevel;            /* level of new_make() */
  60. }    symnode, *symptr;
  61.  
  62. extern targptr target_list;        /* global list of targets */
  63. extern fileptr file_list;        /* global list of file nodes */
  64. extern symptr  symbol_list;        /* global list of symbol nodes */
  65. extern shellptr shell_list;        /* global list of shell nodes */
  66.  
  67. extern int make_level;            /* level of new_make() */
  68.  
  69. extern targptr first_targ;        /* first target (if nothing named) */
  70. extern targptr suffix_targ;        /* target node of ".SUFFIXES" */
  71.  
  72. extern int depend;            /* -d */
  73. extern int display;            /* -D */
  74. extern int envirn;            /* -e */
  75. extern int ignore;            /* -i */
  76. extern int noexec;            /* -n */
  77. extern int readdef;            /* -r */
  78. extern int silent;            /* -s */
  79. extern int touch;            /* -t */
  80.  
  81. #ifndef    MSDOS
  82. char   *getenv();
  83. #define    P_WAIT        1
  84. #define    P_NOWAIT    2
  85. #define    P_OVERLAY    3
  86. #endif
  87.  
  88. #define    REGISTER    register
  89.